package test.sunyu.tools.hbase;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class MyFutureTask extends FutureTask<Object> {

    private static final Logger logger = LoggerFactory.getLogger(Thread.currentThread().getClass());

    public MyFutureTask(Callable<Object> callable) {
        super(callable);
    }

    @Override
    protected void done() {
        try {
            logger.info(get().toString());
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
        super.done();
    }

}
